package com.liao.seckill.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author lzp
 * @version 1.0
 * lzpnb!
 */

@Service
@Slf4j
public class MQSenderMessage {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendSeckillMessage(String message) {
        log.info("发送消息 ->" + message);
        rabbitTemplate.convertAndSend("seckillExchange","seckill.message",message);
    }


}
